<template>
    <div class="">
      <div class="title">
        <div class="logo">
          <img :src="require('assets/gouyan/logo.png')"/>
        </div>
        <div class="title-text">
          <h2>狗眼看电影</h2>
          <p>查影讯，上狗眼电影就够了！</p>
        </div>
        <div class="search">
          <input type="text" placeholder="请输入电影名" @click="gotoSearch"/>
        </div>
      </div>
      <div class="link clearfix">
        <a class="isShowing">正在热映</a>
        <a class="willShow">即将热映</a>
      </div>
      <div class="content">
        <item v-for="movie in movies" :movie="movie" :key="movie.id"></item>
      </div>
    </div>
</template>

<script>
  import 'assets/style.scss'
  import 'assets/style2.css'
  import item from './Item.vue'
export default {
   data:function () {
       return {
           movies:[
               {id:'1', title:'羞羞的铁拳',rank: 7.4, directors: ['宋阳'], actors:['艾伦','马丽'],poster:'https://img1.doubanio.com/view/movie_poster_cover/ipst/public/p2499793218.jpg' },
               {id:'2', title:'羞羞的铁拳',rank: 7.4, directors: ['宋阳'], actors:['艾伦','马丽'],poster:'https://img1.doubanio.com/view/movie_poster_cover/ipst/public/p2499793218.jpg' },
               {id:'3', title:'羞羞的铁拳',rank: 7.4, directors: ['宋阳'], actors:['艾伦','马丽'],poster:'https://img1.doubanio.com/view/movie_poster_cover/ipst/public/p2499793218.jpg' },
               {id:'4', title:'羞羞的铁拳',rank: 7.4, directors: ['宋阳'], actors:['艾伦','马丽'],poster:'https://img1.doubanio.com/view/movie_poster_cover/ipst/public/p2499793218.jpg' },
               {id:'5', title:'羞羞的铁拳',rank: 7.4, directors: ['宋阳'], actors:['艾伦','马丽'],poster:'https://img1.doubanio.com/view/movie_poster_cover/ipst/public/p2499793218.jpg' },
               {id:'6', title:'羞羞的铁拳',rank: 7.4, directors: ['宋阳'], actors:['艾伦','马丽'],poster:'https://img1.doubanio.com/view/movie_poster_cover/ipst/public/p2499793218.jpg' },
               {id:'7', title:'羞羞的铁拳',rank: 7.4, directors: ['宋阳'], actors:['艾伦','马丽'],poster:'https://img1.doubanio.com/view/movie_poster_cover/ipst/public/p2499793218.jpg' },
               {id:'8', title:'羞羞的铁拳',rank: 7.4, directors: ['宋阳'], actors:['艾伦','马丽'],poster:'https://img1.doubanio.com/view/movie_poster_cover/ipst/public/p2499793218.jpg' },
               {id:'9', title:'羞羞的铁拳',rank: 7.4, directors: ['宋阳'], actors:['艾伦','马丽'],poster:'https://img1.doubanio.com/view/movie_poster_cover/ipst/public/p2499793218.jpg' },
               {id:'10', title:'羞羞的铁拳',rank: 7.4, directors: ['宋阳'], actors:['艾伦','马丽'],poster:'https://img1.doubanio.com/view/movie_poster_cover/ipst/public/p2499793218.jpg' },
               {id:'11', title:'羞羞的铁拳',rank: 7.4, directors: ['宋阳'], actors:['艾伦','马丽'],poster:'https://img1.doubanio.com/view/movie_poster_cover/ipst/public/p2499793218.jpg' },
               {id:'12', title:'羞羞的铁拳',rank: 7.4, directors: ['宋阳'], actors:['艾伦','马丽'],poster:'https://img1.doubanio.com/view/movie_poster_cover/ipst/public/p2499793218.jpg' },
               {id:'13', title:'羞羞的铁拳',rank: 7.4, directors: ['宋阳'], actors:['艾伦','马丽'],poster:'https://img1.doubanio.com/view/movie_poster_cover/ipst/public/p2499793218.jpg' },
               {id:'14', title:'羞羞的铁拳',rank: 7.4, directors: ['宋阳'], actors:['艾伦','马丽'],poster:'https://img1.doubanio.com/view/movie_poster_cover/ipst/public/p2499793218.jpg' },
               {id:'15', title:'羞羞的铁拳',rank: 7.4, directors: ['宋阳'], actors:['艾伦','马丽'],poster:'https://img1.doubanio.com/view/movie_poster_cover/ipst/public/p2499793218.jpg' },
               {id:'16', title:'羞羞的铁拳',rank: 7.4, directors: ['宋阳'], actors:['艾伦','马丽'],poster:'https://img1.doubanio.com/view/movie_poster_cover/ipst/public/p2499793218.jpg' },
               {id:'17', title:'羞羞的铁拳',rank: 7.4, directors: ['宋阳'], actors:['艾伦','马丽'],poster:'https://img1.doubanio.com/view/movie_poster_cover/ipst/public/p2499793218.jpg' },
               {id:'18', title:'羞羞的铁拳',rank: 7.4, directors: ['宋阳'], actors:['艾伦','马丽'],poster:'https://img1.doubanio.com/view/movie_poster_cover/ipst/public/p2499793218.jpg' },
           ]
       }
   },
   components:{
     item
   },
   computed: {
   },

  methods: {
       gotoSearch:function () {
           this.$router.push('search')
       }
  }
}
</script>

<style lang="scss" scoped="">
  .title{
    background-color: #E5E9F2;
    position: relative;
    .logo{
      width: 42px;
      height: 42px;
      position: absolute;
      top: 0;
      bottom: 0;
      left: 10px;
      margin: auto;

      img{
        max-width: 100%;
        max-height: 100%;
      }
    }
    .title-text{
      margin-left: 60px;
      margin-right: 11em;
      padding: 10px 0;

      h2{
        font-size: 17px;
        font-weight: 700;
        color: #333;
      }
      p{
        font-size: 12px;
        color: #999;
      }
    }
    .search{
      width: 110px;
      height: 40px;
      position: absolute;
      top: 0;
      bottom: 0;
      right: 10px;
      margin: auto;

      input{
        height: 100%;
        width: 100%;
        border: none;
        background-color: #fff;
        border-radius: 40px;

        font-size: 12px;
        text-align: center;
      }
    }
  }
  .link{
    text-align: center;
    font-size: 20px;

    a{
      display: inline-block;
      line-height: 35px;
      width: 50%;
      background-color: #df2d2d;
      color: #F9FAFC;

      text-decoration: none;
    }
    .isShowing{
      float: left;
    }
    .willShow{
      float: right;
    }
  }
  .content{
    padding: 20px;
    overflow: scroll;

    background-color: #f8f8f8;
  }


</style>
